#pragma once

namespace gugu
{
	// vector<T>::iterator ->
	// list<T>::iterator   ->

	template<class Iterator,class Ref, class ptr>
	struct reverseiterator
	{
		typedef template<Iterator, Ref, ptr> self;
		
		Iterator _it;

		reverseiterator(Iterator it)
			:_it(it)
		{
		}

		Ref operator*()
		{
			Iterator tmp = _it;
			return *(--tmp);
		}

		self& operator++()
		{
			--_it;
			return *this;
		}

		self& operator++()
		{
			++_it;
			return *this;
		}

		bool operator!=(const self& s)
		{
			return _it != s._it;
		}



	};
}